package com.wxzz.elearing.livetelecast.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.livetelecast.entity.LivetelecastRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 直播录播文件 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2021-05-14
 */
public interface LivetelecastRecordMapper extends BaseMapper<LivetelecastRecord> {

    /**
     * 根据媒质ID查询录播内容
     * @param assetId
     * @return
     */
    @Select("SELECT * FROM `livetelecast_record` WHERE asset_id = #{assetId} AND deleted = 0")
    LivetelecastRecord getByAssetId(@Param("assetId") String assetId);

    /**
     * 根据直播id查询媒质情况
     * @param livetelecastId
     * @return
     */
    @Select("SELECT * FROM `livetelecast_record` WHERE livetelecast_id = #{livetelecastId} AND deleted = 0")
    List<LivetelecastRecord> getByLivetelecastId(@Param("livetelecastId") Long livetelecastId);

}
